import {Component, Input, OnInit} from '@angular/core';
import {EntityService} from '../../shared/services/entity.service';
import {IPDialog, IPDialogConfig, IPDialogData} from '../../shared/model/share.model';

@Component({
  selector: 'app-user-dialog',
  template: `
    <app-base-dialog [dialog]="dialog">
      <div class="ui-g">
        <div class="ui-g-12 ui-md-6">
          <div class="ui-g-12 ui-md-4"><label>用户名</label></div>
          <div class="ui-g-12 ui-md-8"><input pInputText id="userName" name="userName" /></div>
        </div>
        <div class="ui-g-12 ui-md-6">
          <div class="ui-g-12 ui-md-4"><label>姓名</label></div>
          <div class="ui-g-12 ui-md-8"><input pInputText id="name" name="name" /></div>
        </div>
      </div>
    </app-base-dialog>
    <!--<p-dialog [header]="title" [(visible)]="display" modal="modal" [width]="800" [responsive]="true">-->
      <!--<div class="ui-g">-->
        <!--<div class="ui-g-12 ui-md-6">-->
          <!--<div class="ui-g-12 ui-md-4"><label>用户名</label></div>-->
          <!--<div class="ui-g-12 ui-md-8"><input pInputText id="userName" name="userName" /></div>-->
        <!--</div>-->
        <!--<div class="ui-g-12 ui-md-6">-->
          <!--<div class="ui-g-12 ui-md-4"><label>姓名</label></div>-->
          <!--<div class="ui-g-12 ui-md-8"><input pInputText id="name" name="name" /></div>-->
        <!--</div>-->
      <!--</div>-->
      <!--<p-footer>-->
        <!--<button type="button" pButton icon="fa-check" (click)="display=false" label="Yes"></button>-->
        <!--<button type="button" pButton icon="fa-close" (click)="display=false" label="No"></button>-->
      <!--</p-footer>-->
    <!--</p-dialog>-->
  `
})
export class UserDialogComponent implements OnInit {
  dictionaries: any;
  @Input() dialog: IPDialog;
  get model(){
    return this.dialog.data.inData;
  }
  constructor(
    private service: EntityService
  ) {}
  ngOnInit() {
    console.log(this.service.test);
    console.log('UserDialogComponent', Date.now());
    this.dictionaries = this.service.dictionaries;
  }
}
